// 这个文件就是专门用来放置侧边栏菜单内容的  就是侧边栏中的选项放置地方
import {
    MenuFoldOutlined,
    MenuUnfoldOutlined,
    UploadOutlined,
    UserOutlined,
    VideoCameraOutlined,
} from '@ant-design/icons';
import Layout from "@/pages/Layout";
import Login from "@/pages/Login";

import Dashboard from "@/pages/dashboard"
import Goodlist from "@/pages/good/goodList"
import Goodform from "@/pages/good/goodForm"
import User from "@/pages/user"

import { FormattedMessage } from 'react-intl';

// 静态路由
export const constantRoutes = [
    { path: "/", element: <Layout />, children: [] },
    { path: "/login", element: <Login />, children: [] },
]


// 动态路由，有权限的路由 
// 这些路由到后期就是根据不同的权限来灵活展示不同的路由选项
export const asyncRoutes = [
    {
        key: 1001,
        path: "/dashboard",
        label: <FormattedMessage id="menu.dashboard" />,
        icon: <MenuFoldOutlined />,
        element: <Dashboard />,
        meta: {
            roles: ['admin', 'editor']
        }
    },
    {
        key: 1002,
        icon: <VideoCameraOutlined />,
        label: <FormattedMessage id="menu.good" />,
        meta: {
            roles: ['editor']
        },
        children: [
            {
                key: 100201,
                path: "/good/list",
                icon: null,
                label: <FormattedMessage id="menu.good.list" />,
                element: <Goodlist />
            },
            {
                key: 100202,
                path: "/good/add",
                icon: null,
                label: <FormattedMessage id="menu.good.add" />,
                element: <Goodform />,
                // hidden: true
            },
            {
                key: 100203,
                path: "/good/edit",
                icon: null,
                label: <FormattedMessage id="menu.good.edit" />,
                element: <Goodform />,
                // hidden: true
            }
        ]
    },
    {
        key: 1003,
        path: "/user",
        element: <User />,
        icon: <UserOutlined />,
        label: <FormattedMessage id="menu.user" />,
        meta: {
            roles: ["admin", "editor"]
        }
    }
];

